<?php
class Api {
	private $port;
	private $url;
	private $host;
	private $sendType;
	private $id;
	private $message;
	private $key;
	private $Time;
	function Api($sendType) {
		$this->port = $_POST[ApiPort];
		$this->host = "Http://127.0.0.1";
		$this->key = "261589289";
		$this->sendType = $sendType;
	}
	
	public function doApi($cluster, $qq) {
		$this->id = $cluster;
		$this->message = $qq;
		$this->createUrl();
		$do = new CurlUtil($this->url);
		$do->init();
		return $do->getBody();
	}

	private function createUrl() {

		$this->url = $this->host . ":" . $this->port . "/Api?key=" . $this->key . "&utf=1&SendType=" . $this->sendType . "&id=" . $this->id . "&message=" .rawurlencode( $this->message)."&Time=".$this->Time;
		myEcho($this->url);
	}
	private function __get($property_name) {
		return $this-> $property_name;

	}

	private function __set($property_name, $value) {
		$this->$property_name = $value;
	}
}
?>